import 'package:flutter_test/flutter_test.dart';
import 'package:tencent_calls_engine/tuicall_engine.dart';
import 'package:tencent_calls_engine/platform/tuicall_engine_platform_interface.dart';
import 'package:tencent_calls_engine/platform/tuicall_engine_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockTuicallEnginePlatform
    with MockPlatformInterfaceMixin
    implements TUICallEnginePlatform {
  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final TUICallEnginePlatform initialPlatform = TUICallEnginePlatform.instance;

  test('$MethodChannelTUICallEngine is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelTUICallEngine>());
  });

  test('getPlatformVersion', () async {
    TUICallEngine tuicallEnginePlugin = TUICallEngine();
    MockTuicallEnginePlatform fakePlatform = MockTuicallEnginePlatform();
    TUICallEnginePlatform.instance = fakePlatform;

    expect(await tuicallEnginePlugin.getPlatformVersion(), '42');
  });
}
